package aiku.numericalcontroloa.Mapper.EmployeeAttendance;

import aiku.numericalcontroloa.Model.Dto.PageSelect;
import aiku.numericalcontroloa.Model.Entity.EmployeeAttendance.ClockinRule;
import aiku.numericalcontroloa.Model.Entity.EmployeeAttendance.ClockinRuleWith;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

/**
 * @Author 黄广庭
 * @Date 2024/2/26 17:43
 */
@Repository
public interface ClockinRuleMapper extends BaseMapper<ClockinRule> {
    /**
     * 联用户表分页查询规则
     * @param pageSelect
     * @param queryWrapper
     * @return
     */
    List<ClockinRuleWith> selectPageWithUser(@Param(value = "page")PageSelect pageSelect,
                                             @Param(Constants.WRAPPER) QueryWrapper<ClockinRuleWith> queryWrapper);

    /**
     * 联部门表查询规则
     * @param pageSelect
     * @param queryWrapper
     * @return
     */
    List<ClockinRuleWith> selectPageWithDepartment(@Param(value = "page")PageSelect pageSelect,
                                                   @Param(Constants.WRAPPER) QueryWrapper<ClockinRuleWith> queryWrapper);

    /**
     * 根据id查询，包括已删除的数据
     */
    ClockinRule selectByIdOnDelete(@Param(value = "id") String id);

    List<ClockinRule> selectBatchByIdWithDelete(@Param(value = "list")Collection<String> list);
}
